<div class="right">

  <div id="columns1">
 
    <ul id="column2" class="main">
      <li class="widget1 color-green1" id="widget13">
        <div class="widget1-head">
          <h3> 当前在线用户 </h3>
       </div>
        <div class="widget1-content">
          <table cellspacing="0" cellpadding="0">
            <tr>
			  <th> 序号 </th>
              <th> 访客 </th>
              <th> 操作系统 </th>
              <th> 系统语言 </th>
			  <th> 浏览器 </th>
              <th> IP </th>
              <th> 地区 </th>
			  <th> 当日来访次数 </th>
			  <th> 操作 </th>
            </tr>



	<?php 
	if(!empty($vid_data)){
	foreach(@$vid_data as $key=>$val):?>								
                  <tr>
                    <td> <?=$key+1?> </td>
                    <td> <?=$val['vid']?> </td>
                    <td> <?=$val['OS']?></td>
                    <td> <?=$val['OSLang']?> </td>
					<td> <?=$val['browser_Name']?></td>
                    <td> <?=$val['ip']?> </td>
					<td> <?=$val['city']?> </td>
					<td> <?=$val['arriveTimes']?> </td>
					<td id="state_<?=$val['vid']?>"> 
                    <?php  if($val['state'] == 1) {?>
                   		 <label onclick="lanjie(2,<?=$val['vid']?>)">取消拦截</label>
                    <?php }else{ ?>
                   		 <label onclick="lanjie(1,<?=$val['vid']?>)">拦截</label>
                    <?php } ?>
                    
                    </td>
                  </tr>
 <?php endforeach;
 	}else{
 ?>
                  <tr>
                  <td colspan="13"><center>
                      <font color=red>无数据</font>
                    </center></td>
                </tr>
<?php } ?>				
          </table>
        </div>
      </li>
    </ul>
  </div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
	function lanjie(state,vid)
	{
		$.ajax({
		   type: "POST",
		   url: "<?=$this->config->item('site_url');?>SystemFunctions/vidguanbi",
		   data: "lanjie_vid="+vid+"&state="+state,
		   success: function(msg){
			 $("#state_"+vid).html('<label onclick="lanjie(2,'+vid+')">取消拦截</label>');
		   }
		}); 
	}
</script>
